home *** CD-ROM | disk | FTP | other *** search
/ boe.pres.k12.wv.us / boe.pres.k12.wv.us.zip / boe.pres.k12.wv.us / Utilities / Xerox Workcentre 5335 / Windows Scan / 64-bit_x64 / Russian / cpsimage.cab / data / sys / datetime.elf < prev    next >
Text File  |  2009-04-23  |  2KB  |  58 lines

  1. /*
  2. ** $Id: datetime.elf,v 1.4 2009/04/20 20:49:13 isimmons Exp $
  3. */
  4.  
  5. /******************************************************************************/
  6. /*
  7. ** This class provides access to date and time on the system. See elfmiscsys.c.
  8. */
  9. /* @New
  10. // DESCRIPTION
  11.   Creates a new instance of DATETIME to specified date and time. Any value not given
  12.   will default to its corresponding value in the Epoch, January 1, 1970 00:00:00 GMT.
  13.  
  14. //Example
  15. #load "sys/datetime.elf";
  16.  
  17. DATETIME dt = DATETIME.now (utc: TRUE);
  18. STRING   time = dt.toString ();
  19.  
  20. DATETIME dt = new (DATETIME, year:2010, hour:15, min:15, sec:15);
  21. print dt.toString ();
  22.  
  23. // Note the setDateTime is static time, i.e., does not increment time.
  24. */
  25. /* @now Creates a new instance with the current time and date in local time or Coordinated Universal Time (UTC).*/
  26. /* @toLocalTime Convert value of this instance to local time. */
  27. /* @toUTC Convert value of this instance to Coordinated Universal Time (UTC). */
  28. /* @toString Convert value of this instance to its equivalent string representation using specified format string. */
  29.  
  30. /******************************************************************************/
  31. CLASS DATETIME {
  32.     STRING HTTP_FORMAT = "EEE', 'dd' 'MMM' 'YYYY' 'HH':'mm':'ss' GMT'";
  33.     STRING W3C_FORMAT  = "YYYY'-'MM'-'dd'T'HH':'mm':'ssZZ";
  34.     STRING W3CZ_FORMAT = "YYYY'-'MM'-'dd'T'HH':'mm':'ss'Z'";
  35.  
  36.     METHOD New( INTEGER year, INTEGER month, INTEGER day,
  37.                 INTEGER hour, INTEGER min, INTEGER sec, BOOLEAN utc )
  38.        NATIVE "ElfDateTimeMethods@builtins";
  39.     METHOD Free() NATIVE "ElfDateTimeMethods@builtins";
  40.     METHOD Empty() RETURNS (BOOLEAN empty)
  41.        NATIVE "ElfDateTimeMethods@builtins";
  42.  
  43.     METHOD now( BOOLEAN utc ) RETURNS (DATETIME dt)
  44.         NATIVE "ElfDateTimeMethods@builtins";
  45.  
  46.     METHOD getTime() RETURNS ( LONG time )
  47.        NATIVE "ElfDateTimeMethods@builtins";
  48.  
  49.     METHOD toLocalTime() RETURNS (DATETIME dt)
  50.        NATIVE "ElfDateTimeMethods@builtins";
  51.  
  52.     METHOD toUTC() RETURNS (DATETIME dt)
  53.        NATIVE "ElfDateTimeMethods@builtins";
  54.  
  55.     METHOD toString( STRING format ) RETURNS (STRING timestamp)
  56.        NATIVE "ElfDateTimeMethods@builtins";
  57. }
  58.